package de.homelabs.hlmodules.cms.api.template.service;

import java.io.IOException;
import java.io.Reader;

import de.homelabs.hlmodules.cms.template.domain.HLTemplate;
import de.homelabs.hlmodules.cms.template.domain.HLTemplateException;

public interface IHLTemplateManager {

	/**
	 * Finds the object that acts as the source of the template with the given
	 * name
	 * 
	 * @param name
	 * @return Object
	 * @throws IOException
	 */
	public HLTemplate findTemplateSource(String name) throws HLTemplateException;

	/**
	 * Returns the time of last modification of the specified template source.
	 * 
	 * @param templateSource
	 * @return long
	 */
	public long getLastModified(HLTemplate templateSource) throws HLTemplateException;

	/**
	 * Returns the character stream of a template represented by the specified
	 * template source.
	 * 
	 * @param templateSource
	 * @param encoding
	 * @return Reader
	 * @throws IOException
	 */
	public Reader getReader(HLTemplate templateSource, String encoding) throws HLTemplateException;

	/**
	 * Closes the template source
	 * 
	 * @param templateSource
	 * @throws IOException
	 */
	public void closeTemplateSource(HLTemplate templateSource) throws HLTemplateException;
}
